<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>title</title>
    <link rel="stylesheet" href="../assets/agile/css/ratchet/css/ratchet.min.css">
    <link rel="stylesheet" href="../assets/agile/css/flat/flat.component.css">
    <link rel="stylesheet" href="../assets/agile/css/flat/flat.color.css">
    <link rel="stylesheet" href="../assets/agile/css/flat/iconline.css">
    <link rel="stylesheet" href="../assets/app/css/app.css" />
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript" src="../script/jquery.js"></script>
<script type="text/javascript" src="../script/config.js"></script>
<script type="text/javascript" src="../script/jquery.form.js"></script>
<script type="text/javascript" src="../script/local.js"></script>
<script type="text/javascript" src="../script/common.js"></script>
<body>
<div id="ios-top-box">
	<div id="header" class="bar bar-nav">
	    <div class="titlebar">
	        <a href="javascript:appClose('sign',api);"><i class="iconfont iconline-arrow-left"></i></a>
	        <h1 class="title">设置签名</h1>
	    </div>
	</div>
</div>
<section class="common-section" style="margin-top:64px !important;">
<div class="scroller reset-pwd">
<div class="block20"></div>

	<ul>

		<li style="width:90%;margin:0 auto;">
			
			<textarea rows="5" name="qianming" style="padding:5px;" placeholder="请输入签名" id="sign"></textarea>
		</li>
		
	</ul>

  <button class="btn btn-positive btn-block login-btn reset-pwd-btn" style="font-size:18px;padding:7px 0;width:50%;">保存</button>

<div class="clear"></div>
</div>
</section>
<script type="text/javascript">
apiready = function(){

	if(getUserinfo()){
		var userinfo = getUserinfo();
		
        GetJPData(config.url+'/app.php?act=updateuser&uid='+userinfo.uid,{},function(data){
            $('textarea[name=qianming]').val(data.data.qianming);
        });
		
        $('.reset-pwd-btn').click(function(){            
        var qianming = $('textarea[name=qianming]').val();
        if(qianming == ''){
            appToast('请输入个性签名内容');
            return false;
        }
        if(qianming.length > 80 || qianming.length < 2){
            appToast('个性签名内容长度2～80之间');
            return false;
        }
        api.showProgress({title : '正在保存...',text : ''});
        PostData(config.url+'/app.php?act=set_signmin&uid='+userinfo['uid'],{param: qianming},function(data){
                api.hideProgress();
                userinfo['qianming'] = qianming;
                localData.set('userinfo',JSON.stringify(userinfo));
                appToast(data['msg']);
        });
       });
	}else{
		$.PageDialog.fail('请登录用户');
	}
};
</script>
</body>
</html>